<template>
  <div class="login_container">
    <div class="login_main">
      <div class="login_title">
        <div class="logo-pic"></div>
        <h4>
          欢迎登陆-机构信息建档管理系统
        </h4>
      </div>
      <el-form
        :model="ruleForm"
        status-icon
        ref="ruleForm"
        label-width="100px"
      >
        <el-form-item label="管理员名" prop="adminName">
          <el-input
            type="text"
            v-model="ruleForm.adminName"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="adminPassword">
          <el-input
            show-password
            type="password"
            v-model="ruleForm.adminPassword"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm('ruleForm')"
            >登录</el-button
          >
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {
        adminName: "admin",
        adminPassword: "123456",
      },
    };
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          // alert("登录");
          this.$router.push("/home");
        } else {
          console.log("账户错误！");
          return false;
        }
      });
    },
  },
};
</script>

<style scoped>

.login_container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  background-color: #2b4b6b;
}
.login_container .login_main {
  background-color: #b4d2f0;
  border: 4px solid #b4d2f0;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  padding: 10px;
  width: 400px;
  height: 280px;
}

.login_container .login_main .login_title {
  /* line-height: 50px; */
  text-align: center;
  font-size: 20px;
  padding: 10px;
}

</style>